import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
		path:'/login',
		name:'login',
		component: () => import('@/views/login')
	},
	{
		path:'/',
		component: () => import('@/views/layout/Layout.vue'),
		children:[
			{
				path:'',
				name:'home',
				component: () => import('@/views/home/Home.vue')
			},
			{
				path:'/qa',
				name:'qa',
				component: () => import('@/views/qa/Qa.vue')
			},
			{
				path:'/my',
				name:'my',
				component: () => import('@/views/my/My.vue')
			},
			{
				path:'/video',
				name:'video',
				component: () => import('@/views/video/Video.vue')
			}
			
		]
	},
	{
		path:'/search',
		name:'search',
		component: () => import('@/views/search')
	},
	{
		path:'/article/:articleId',
		name:'article',
		component: () => import('@/views/article'),
		props: true
	},
	{
		path:'/user/profile',
		name:'user-profile',
		component: () => import('@/views/user-profile')
	},
	{
		path:'/user/chat',
		name:'user-chat',
		component: () => import('@/views/user-chat')
	},
	
]

const router = new VueRouter({
  routes
})

export default router
